package model;

/*
 * Klasse Member
 * 
 * @author Magnus Brieler
 */
public class Member {
	
	//Attribute
	private User user;
	private Chatroom chatroom;
	
	//Konstruktoren
	public Member() {
		user = new User();
		chatroom = new Chatroom();
	}
	
	public Member(User u, Chatroom room) {
		this.user = u;
		this.chatroom = room;
	}
	
	//Getter
	public User getUser() {
		return user;
	}
	
	public Chatroom getChatroom() {
		return chatroom;
	}
	
	//Setter
	public void setUser(User u) {
		this.user = u;
	}
	
	public void setChatroom(Chatroom room) {
		this.chatroom = room;
	}
	
	//Methoden
	public boolean equals(Object o) {
		return user.getId() == ((Member)o).getUser().getId() && chatroom.getId() == ((Member)o).getChatroom().getId();
	}
	
}